package com.xl.domain.result;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;

@Data
@Getter
@Setter
public class AjaxResult<T> {

    //成功
    public static final AjaxResult SUCCESS=new AjaxResult(0,"操作成功");
    //失败
    public static final AjaxResult Fail=new AjaxResult(1,"操作失败");


    //返回对象
    private T data;

    //状态码
    private int code;

    //提示信息
    private String msg;


    public AjaxResult(){}

    public AjaxResult(int code, String msg){
        this.code=code;
        this.msg=msg;
    }


    public AjaxResult(int code, String msg, T data){
        this.code=code;
        this.msg=msg;
        this.data=data;
    }
}
